
import React, { Suspense } from 'react'
import { HashRouter as Router, Switch } from 'react-router-dom'
import IndexLoading from './indexLoading'
import renderRoutes from './renderRoutes'
import { rootRoutes } from './routerConfig'

const RootRouter = () => (
  <Router>
    <Suspense fallback={<IndexLoading />}>
      <Switch>
        {renderRoutes(rootRoutes)}
      </Switch>
    </Suspense>
  </Router>
)

export default RootRouter;